<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul li:hover{
            background: red;
        }
    </style>
</head>
<body>
    <script>
        var arr=["bule","cyan","pink","red","black","green","yellow"]
        console.log(arr.indexOf("red"))
        
        console.log(arr[3])

        for(var i=0;i<arr.length;i++){
            //console.log(arr[i])
            if(arr[i]==='red'){
                console.log(i)
            }
        }

        var str=''
        for(var i=0;i<5;i++){
            str=str +'<li>列表项'+i+'</li>'
        }
        console.log(str)
        document.write('<ul>'+str+'</ul>')


        var obj={
            a:'10',
            b:'100',
            c:'1000'
        }
        var arr=[]
        for (var key in obj){
            console.log(key)
            console.log(obj[key])
            arr[key]=obj[key]
        }
        console.log(arr)
    </script>
</body>
</html>